import request from '@/util/request'
import store from '@/vuex/store'

// 获得竣工验收数据
export function getCompletListApi(list) {
    const value = {
        pageSize: list.pageSize,
        currentPage: list.currentPage,
        appKey: '',
        appFlag: 2,
        token: store.getters.token,
        versionCode: 0,
        param: JSON.stringify(list)
    }
    return request({
        url: 'complet/getCompletListApi.do',
        method: 'post',
        data: value
    })
}
// 不通过
export function notPassApi(list) {
    const value = {
        appKey: '',
        appFlag: 2,
        token: store.getters.token,
        versionCode: 0,
        param: JSON.stringify(list)
    }
    return request({
        url: 'complete/notPassApi.do',
        method: 'post',
        data: value
    })
}

// 不通过到三到场
export function returnCompleteApi(list) {
    const value = {
        appKey: '',
        appFlag: 2,
        token: store.getters.token,
        versionCode: 0,
        param: JSON.stringify(list)
    }
    return request({
        url: 'complete/returnComplete.do',
        method: 'post',
        data: value
    })
}

// 修改验收表数据
export function updateCheckFormApi(list) {
    const value = {
        appKey: '',
        appFlag: 2,
        token: store.getters.token,
        versionCode: 0,
        param: JSON.stringify(list)
    }
    return request({
        url: 'complete/modifyCheckInfo.do',
        method: 'post',
        data: value
    })
}

export function lookPublicityApi(applyCode){
    const value = {
        appKey: '',
        appFlag: 2,
        token: store.getters.token,
        versionCode: 0,
        param: applyCode
    }
    return request({
        url: 'complete/lookPublicity.do',
        method: 'post',
        data: value
    })
}